package com.ruoyi.asms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.asms.domain.AsmsOwnMaintenanceDept;
import com.ruoyi.asms.mapper.AsmsOwnMaintenanceDeptMapper;
import com.ruoyi.asms.service.IAsmsOwnMaintenanceDeptService;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资产设备所有方和资产维护部门信息Service业务层处理
 * 
 * @author yfkj
 * @date 2021-10-21
 */
@Service
public class AsmsOwnMaintenanceDeptServiceImpl extends ServiceImpl<AsmsOwnMaintenanceDeptMapper, AsmsOwnMaintenanceDept>  implements IAsmsOwnMaintenanceDeptService
{
    @Autowired
    private AsmsOwnMaintenanceDeptMapper asmsOwnMaintenanceDeptMapper;

    /**
     * 查询资产设备所有方和资产维护部门信息
     * 
     * @param assetOwnMaintenanceDeptId 资产设备所有方和资产维护部门信息主键
     * @return 资产设备所有方和资产维护部门信息
     */
    @Override
    public AsmsOwnMaintenanceDept selectAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptId(Long assetOwnMaintenanceDeptId)
    {
        return asmsOwnMaintenanceDeptMapper.selectAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptId(assetOwnMaintenanceDeptId);
    }

    /**
     * 查询资产设备所有方和资产维护部门信息列表
     * 
     * @param asmsOwnMaintenanceDept 资产设备所有方和资产维护部门信息
     * @return 资产设备所有方和资产维护部门信息
     */
    @Override
    public List<AsmsOwnMaintenanceDept> selectAsmsOwnMaintenanceDeptList(AsmsOwnMaintenanceDept asmsOwnMaintenanceDept)
    {
        return asmsOwnMaintenanceDeptMapper.selectAsmsOwnMaintenanceDeptList(asmsOwnMaintenanceDept);
    }

    /**
     * 新增资产设备所有方和资产维护部门信息
     * 
     * @param asmsOwnMaintenanceDept 资产设备所有方和资产维护部门信息
     * @return 结果
     */
    @Override
    public int insertAsmsOwnMaintenanceDept(AsmsOwnMaintenanceDept asmsOwnMaintenanceDept)
    {
        asmsOwnMaintenanceDept.setCreateTime(System.currentTimeMillis());
        asmsOwnMaintenanceDept.setCreateBy(SecurityUtils.getUsername());
        return asmsOwnMaintenanceDeptMapper.insertAsmsOwnMaintenanceDept(asmsOwnMaintenanceDept);
    }

    /**
     * 修改资产设备所有方和资产维护部门信息
     * 
     * @param asmsOwnMaintenanceDept 资产设备所有方和资产维护部门信息
     * @return 结果
     */
    @Override
    public int updateAsmsOwnMaintenanceDept(AsmsOwnMaintenanceDept asmsOwnMaintenanceDept)
    {
        asmsOwnMaintenanceDept.setUpdateTime(System.currentTimeMillis());
        asmsOwnMaintenanceDept.setUpdateBy(SecurityUtils.getUsername());

        return asmsOwnMaintenanceDeptMapper.updateAsmsOwnMaintenanceDept(asmsOwnMaintenanceDept);
    }

    /**
     * 批量删除资产设备所有方和资产维护部门信息
     * 
     * @param assetOwnMaintenanceDeptIds 需要删除的资产设备所有方和资产维护部门信息主键
     * @return 结果
     */
    @Override
    public int deleteAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptIds(Long[] assetOwnMaintenanceDeptIds)
    {
        return asmsOwnMaintenanceDeptMapper.deleteAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptIds(assetOwnMaintenanceDeptIds);
    }

    /**
     * 删除资产设备所有方和资产维护部门信息信息
     * 
     * @param assetOwnMaintenanceDeptId 资产设备所有方和资产维护部门信息主键
     * @return 结果
     */
    @Override
    public int deleteAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptId(Long assetOwnMaintenanceDeptId)
    {
        return asmsOwnMaintenanceDeptMapper.deleteAsmsOwnMaintenanceDeptByAssetOwnMaintenanceDeptId(assetOwnMaintenanceDeptId);
    }
}
